import { RouteRecordRaw } from "vue-router";
import ACCESS_ENUM from "@/access/accessEnum";
import UserLayout from "@/layouts/UserLayout.vue";
import UserLoginView from "@/views/user/UserLoginView.vue";
import UserRegisterView from "@/views/user/UserRegisterView.vue";
import AddQuestionView from "@/views/question/AddQuestionView.vue";
import MenageQuestionView from "@/views/question/MenageQuestionView.vue";
import QuestionsView from "@/views/question/QuestionsView.vue";
import ViewQuestionsView from "@/views/question/ViewQuestionsView.vue";
import QuestionSubmitView from "@/views/question/QuestionSubmitView.vue";
import PersonalCenterView from "@/views/user/PersonalCenterView.vue";
import SearchView from "@/views/search/SearchPageView.vue";
import PostView from "@/views/post/PostView.vue";
import HomePageView from "@/views/HomePageView.vue";
import UserNotice from "@/views/Home/UserNotice.vue";
import QuestionStep from "@/views/Home/QuestionStep.vue";
import QuestionExplain from "@/views/Home/QuestionExplain.vue";
import PostTip from "@/views/Home/PostTip.vue";
import NoticeTips from "@/views/Home/NoticeTips.vue";
import ViewPostView from "@/views/post/ViewPostView.vue";
import AddPostView from "@/views/post/AddPostView.vue";
import PersonalHomePageView from "@/views/user/PersonalHomePageView.vue";
import bigModel from "@/views/bigModel/BigModel.vue";

export const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: " 🏠主页",
    component: HomePageView,
  },
  {
    path: "/userNotice",
    name: "用户须知",
    component: UserNotice,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
  {
    path: "/questionStep",
    name: "做题步骤",
    component: QuestionStep,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
  {
    path: "/questionExplain",
    name: "题目说明",
    component: QuestionExplain,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
  {
    path: "/postTip",
    name: "帖子说明",
    component: PostTip,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
  {
    path: "/noticeTips",
    name: "注意事项",
    component: NoticeTips,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
  {
    path: "/post",
    name: "📝讨论",
    component: PostView,
  },
  {
    path: "/questions",
    name: "📚题库",
    component: QuestionsView,
  },
  {
    path: "/bigModel",
    name: "💡AI问答",
    component: bigModel,
  },
  {
    path: "/user",
    name: "用户",
    component: UserLayout,
    children: [
      {
        path: "/user/login",
        name: "用户登录",
        component: UserLoginView,
      },
      {
        path: "/user/register",
        name: "用户注册",
        component: UserRegisterView,
      },
    ],
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: "/add/question",
    name: "📥创建题目",
    component: AddQuestionView,
    meta: {
      access: ACCESS_ENUM.ADMIN,
    },
  },
  {
    path: "/menage/question",
    name: "📤管理题目",
    component: MenageQuestionView,
    meta: {
      access: ACCESS_ENUM.ADMIN,
    },
  },
  {
    path: "/personal/center",
    name: "用户中心",
    component: PersonalCenterView,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
  {
    path: "/personal/homepage",
    name: "个人主页",
    component: PersonalHomePageView,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
  {
    path: "/update/question",
    name: "更新题目",
    component: AddQuestionView,
    meta: {
      access: ACCESS_ENUM.ADMIN,
      hideInMenu: true,
    },
  },
  {
    path: "/questions/:category",
    component: QuestionsView,
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: "/add/post",
    name: "新增帖子",
    component: AddPostView,
    meta: {
      hideInMenu: true,
      access: ACCESS_ENUM.USER,
    },
  },
  {
    path: "/update/post",
    name: "更新帖子",
    component: AddPostView,
    meta: {
      hideInMenu: true,
      access: ACCESS_ENUM.USER,
    },
  },
  {
    path: "/view/post/:id",
    name: "帖子详细",
    component: ViewPostView,
    props: true,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
  {
    path: "/question_submit",
    name: "📑提交记录",
    component: QuestionSubmitView,
    meta: {
      access: ACCESS_ENUM.ADMIN,
    },
  },
  {
    path: "/view/question/:id/:category?/:questionSubmitId?",
    name: "在线做题",
    component: ViewQuestionsView,
    props: true,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
  {
    path: "/search",
    name: "聚合搜索",
    component: SearchView,
    props: true,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
  {
    path: "/search/:category",
    component: SearchView,
    props: true,
    meta: {
      access: ACCESS_ENUM.USER,
      hideInMenu: true,
    },
  },
];
